package com.webgis.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webgis.mapper.SzryMapper;
import com.webgis.pojo.Szry;
import com.webgis.service.SzryService;
import com.webgis.utils.WFSCapabilitiesGenerator;
import com.webgis.utils.WFSDescribeFeatureTypeGenerator;
import com.webgis.utils.WFSGetFeatureGenerator;

@Service
public class SzryServiceImpl implements SzryService {
    @Autowired
    private SzryMapper szryMapper;

    @Autowired
    private WFSCapabilitiesGenerator wfsCapabilitiesGenerator;

    @Autowired
    private WFSDescribeFeatureTypeGenerator wfsDescribeFeatureTypeGenerator;

    @Autowired
    private WFSGetFeatureGenerator wfsGetFeatureGenerator;

    @Override
    public List<Szry> getAllPersons() {
        return szryMapper.findAll();
    }

    @Override
    public String generateGetCapabilitiesResponse() {
        return wfsCapabilitiesGenerator.createWFSCapabilities();
    }

    @Override
    public String generateDescribeFeatureTypeResponse() {
        return wfsDescribeFeatureTypeGenerator.createWFSDescribeFeatureType();
    }

    @Override
    public String generateGetFeatureResponse(List<Szry> persons) {
        return wfsGetFeatureGenerator.createWFSGetFeature(persons);
    }
}
